package com.ye.personnel.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

/**
 * @Author: yeubo
 * @Date: 2024/1/2 17:13
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum AuthorizedTypeEnum {

    XZ("1","行政编制"),
    CG("2","事业编制(参公)"),
    SY("3","事业编制(其他)"),
    GQ("4","工勤编制"),
    QT("9","其他编制");

    public String type;
    public String name;

    public static String getName(String type){
        AuthorizedTypeEnum typeEnum = Stream.of(values())
                .filter(t -> t.type.equals(type))
                .findFirst()
                .orElse(QT);
        return typeEnum.getName();
    }
}
